100
How do I enable the cross link support ( rectangular )

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element <sha ;;0>A",vtMissing,vtMissing);
	var_Elements->Add("Element <sha ;;0>B",long(0),long(76));
	EXSURFACELib::IElementPtr var_Element = var_Elements->Add("Element <sha ;;0>C",long(-76),long(32));
		var_Element->PutAutoSize(VARIANT_FALSE);
		var_Element->PutHeight(32);
	EXSURFACELib::IElementPtr var_Element1 = var_Elements->Add("Element <sha ;;0>D",long(76),long(32));
		var_Element1->PutAutoSize(VARIANT_FALSE);
		var_Element1->PutHeight(32);
EXSURFACELib::ILinksPtr var_Links = spSurface1->GetLinks();
	EXSURFACELib::ILinkPtr var_Link = var_Links->Add(spSurface1->GetElements()->GetItem(long(1)),spSurface1->GetElements()->GetItem(long(2)),vtMissing);
		var_Link->PutStartPos(EXSURFACELib::CenterAlignment);
		var_Link->PutEndPos(EXSURFACELib::CenterAlignment);
	EXSURFACELib::ILinkPtr var_Link1 = var_Links->Add(spSurface1->GetElements()->GetItem(long(2)),spSurface1->GetElements()->GetItem(long(1)),vtMissing);
		var_Link1->PutStartPos(EXSURFACELib::CenterAlignment);
		var_Link1->PutEndPos(EXSURFACELib::CenterAlignment);
	var_Links->Add(spSurface1->GetElements()->GetItem(long(3)),spSurface1->GetElements()->GetItem(long(4)),vtMissing);
	EXSURFACELib::ILinkPtr var_Link2 = var_Links->Add(spSurface1->GetElements()->GetItem(long(4)),spSurface1->GetElements()->GetItem(long(3)),vtMissing);
		var_Link2->PutStartPos(EXSURFACELib::LeftAlignment);
		var_Link2->PutEndPos(EXSURFACELib::RightAlignment);
spSurface1->PutShowLinks(EXSURFACELib::ShowExtendedLinksEnum(EXSURFACELib::exShowCrossLinksRect | EXSURFACELib::exShowExtendedLinks));

99
How do I show a link frmo bottom to top, or reverse, not from left to right

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element <sha ;;0>A",vtMissing,vtMissing);
	var_Elements->Add("Element <sha ;;0>B",long(0),long(64));
EXSURFACELib::ILinksPtr var_Links = spSurface1->GetLinks();
	EXSURFACELib::ILinkPtr var_Link = var_Links->Add(spSurface1->GetElements()->GetItem(long(1)),spSurface1->GetElements()->GetItem(long(2)),vtMissing);
		var_Link->PutStartPos(EXSURFACELib::CenterAlignment);
		var_Link->PutEndPos(EXSURFACELib::CenterAlignment);

98
What options to align the elements do I have if I use Arrange method

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->BeginUpdate();
spSurface1->PutShowGridLines(VARIANT_TRUE);
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	_variant_t h1 = var_Elements->Add("Top Alignment",vtMissing,vtMissing)->GetID();
	var_Elements->Add("Element",vtMissing,vtMissing);
	var_Elements->Add("Element",vtMissing,vtMissing);
	var_Elements->Add("Element",vtMissing,vtMissing);
	_variant_t h2 = var_Elements->Add("Center Alignment",vtMissing,long(96))->GetID();
	var_Elements->Add("Element",vtMissing,long(96));
	var_Elements->Add("Element",vtMissing,long(96));
	var_Elements->Add("Element",vtMissing,long(96));
	_variant_t h3 = var_Elements->Add("Bottom Alignment",vtMissing,long(178))->GetID();
	var_Elements->Add("Element",vtMissing,long(192));
	var_Elements->Add("Element",vtMissing,long(192));
	var_Elements->Add("Element",vtMissing,long(192));
EXSURFACELib::ILinksPtr var_Links = spSurface1->GetLinks();
	var_Links->Add(spSurface1->GetElements()->GetItem(long(1)),spSurface1->GetElements()->GetItem(long(2)),vtMissing);
	var_Links->Add(spSurface1->GetElements()->GetItem(long(1)),spSurface1->GetElements()->GetItem(long(3)),vtMissing);
	var_Links->Add(spSurface1->GetElements()->GetItem(long(2)),spSurface1->GetElements()->GetItem(long(4)),vtMissing);
	var_Links->Add(spSurface1->GetElements()->GetItem(long(2)),spSurface1->GetElements()->GetItem(long(3)),vtMissing);
	var_Links->Add(spSurface1->GetElements()->GetItem(long(5)),spSurface1->GetElements()->GetItem(long(6)),vtMissing);
	var_Links->Add(spSurface1->GetElements()->GetItem(long(5)),spSurface1->GetElements()->GetItem(long(7)),vtMissing);
	var_Links->Add(spSurface1->GetElements()->GetItem(long(6)),spSurface1->GetElements()->GetItem(long(8)),vtMissing);
	var_Links->Add(spSurface1->GetElements()->GetItem(long(6)),spSurface1->GetElements()->GetItem(long(7)),vtMissing);
	var_Links->Add(spSurface1->GetElements()->GetItem(long(9)),spSurface1->GetElements()->GetItem(long(10)),vtMissing);
	var_Links->Add(spSurface1->GetElements()->GetItem(long(9)),spSurface1->GetElements()->GetItem(long(11)),vtMissing);
	var_Links->Add(spSurface1->GetElements()->GetItem(long(10)),spSurface1->GetElements()->GetItem(long(12)),vtMissing);
	var_Links->Add(spSurface1->GetElements()->GetItem(long(10)),spSurface1->GetElements()->GetItem(long(11)),vtMissing);
spSurface1->PutDefArrange(EXSURFACELib::exDefArrangeAlign,long(0));
spSurface1->Arrange(h1);
spSurface1->PutDefArrange(EXSURFACELib::exDefArrangeAlign,long(1));
spSurface1->Arrange(h2);
spSurface1->PutDefArrange(EXSURFACELib::exDefArrangeAlign,long(2));
spSurface1->Arrange(h3);
spSurface1->EndUpdate();

97
Is there an auto-arrange feature that will display the flow-chart centered and zoomed correctly after we are finished building it

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element A",vtMissing,vtMissing)->PutID("A");
	var_Elements->Add("Element B",vtMissing,vtMissing)->PutID("B");
	var_Elements->Add("Element C",vtMissing,vtMissing)->PutID("C");
	var_Elements->Add("Element D",vtMissing,vtMissing)->PutID("D");
EXSURFACELib::ILinksPtr var_Links = spSurface1->GetLinks();
	var_Links->Add(spSurface1->GetElements()->GetItem("A"),spSurface1->GetElements()->GetItem("B"),vtMissing);
	var_Links->Add(spSurface1->GetElements()->GetItem("A"),spSurface1->GetElements()->GetItem("C"),vtMissing);
	var_Links->Add(spSurface1->GetElements()->GetItem("B"),spSurface1->GetElements()->GetItem("D"),vtMissing);
	var_Links->Add(spSurface1->GetElements()->GetItem("B"),spSurface1->GetElements()->GetItem("C"),vtMissing);
spSurface1->Arrange(vtMissing);

96
Is it possible to change the distance between elements, when calling the Arrange method

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element A",vtMissing,vtMissing)->PutID("A");
	var_Elements->Add("Element B",vtMissing,vtMissing)->PutID("B");
	var_Elements->Add("Element C",vtMissing,vtMissing)->PutID("C");
	var_Elements->Add("Element D",vtMissing,vtMissing)->PutID("D");
EXSURFACELib::ILinksPtr var_Links = spSurface1->GetLinks();
	var_Links->Add(spSurface1->GetElements()->GetItem("A"),spSurface1->GetElements()->GetItem("B"),vtMissing);
	var_Links->Add(spSurface1->GetElements()->GetItem("A"),spSurface1->GetElements()->GetItem("C"),vtMissing);
	var_Links->Add(spSurface1->GetElements()->GetItem("B"),spSurface1->GetElements()->GetItem("D"),vtMissing);
	var_Links->Add(spSurface1->GetElements()->GetItem("B"),spSurface1->GetElements()->GetItem("C"),vtMissing);
spSurface1->PutDefArrange(EXSURFACELib::exDefArrangeDX,long(0));
spSurface1->PutDefArrange(EXSURFACELib::exDefArrangeDY,long(0));
spSurface1->Arrange(vtMissing);

95
How do I organize vertically the elements

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element A",vtMissing,vtMissing)->PutID("A");
	var_Elements->Add("Element B",vtMissing,vtMissing)->PutID("B");
	var_Elements->Add("Element C",vtMissing,vtMissing)->PutID("C");
	var_Elements->Add("Element D",vtMissing,vtMissing)->PutID("D");
EXSURFACELib::ILinksPtr var_Links = spSurface1->GetLinks();
	var_Links->Add(spSurface1->GetElements()->GetItem("A"),spSurface1->GetElements()->GetItem("B"),vtMissing);
	var_Links->Add(spSurface1->GetElements()->GetItem("A"),spSurface1->GetElements()->GetItem("C"),vtMissing);
	var_Links->Add(spSurface1->GetElements()->GetItem("B"),spSurface1->GetElements()->GetItem("D"),vtMissing);
	var_Links->Add(spSurface1->GetElements()->GetItem("B"),spSurface1->GetElements()->GetItem("C"),vtMissing);
spSurface1->PutShowLinksType(EXSURFACELib::exLinkStraight);
spSurface1->PutDefArrange(EXSURFACELib::exDefArrangeDir,long(1));
spSurface1->Arrange(vtMissing);

94
Is there a way to create a link which has the same start and end element

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element",vtMissing,vtMissing);
EXSURFACELib::ILinksPtr var_Links = spSurface1->GetLinks();
	var_Links->Add(spSurface1->GetElements()->GetItem(long(1)),spSurface1->GetElements()->GetItem(long(1)),vtMissing);

93
How can I prevent hiding the item when an item with an outgoing link, is collapsed

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Item <sha ;;0>1",vtMissing,vtMissing)->PutID(long(1));
	var_Elements->Insert("Item <sha ;;0>2",long(1),vtMissing)->PutID(long(2));
	EXSURFACELib::IElementPtr var_Element = var_Elements->Add("Item <sha ;;0>3",vtMissing,vtMissing);
		var_Element->PutID(long(3));
		var_Element->PutX(96);
		var_Element->PutY(23);
EXSURFACELib::ILinksPtr var_Links = spSurface1->GetLinks();
	var_Links->Add(spSurface1->GetElements()->GetItem(long(2)),spSurface1->GetElements()->GetItem(long(3)),vtMissing);
spSurface1->PutShowLinksOnCollapse(VARIANT_TRUE);

92
How can I change the toolbar's visual appearance

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->GetVisualAppearance()->Add(1,"c:\\exontrol\\images\\normal.ebn");
spSurface1->PutBackground(EXSURFACELib::exToolBarAppearance,0x1000000);
spSurface1->PutBackground(EXSURFACELib::exToolBarBackColor,RGB(255,255,255));
spSurface1->PutBackground(EXSURFACELib::exToolBarForeColor,RGB(40,40,40));
spSurface1->PutBackground(EXSURFACELib::exToolBarButtonDownBackColor,0x1606060);
spSurface1->PutBackground(EXSURFACELib::exToolBarButtonDownForeColor,RGB(240,240,240));
spSurface1->PutBackground(EXSURFACELib::exToolBarButtonHotBackColor,0x1a0a0a0);
spSurface1->PutBackground(EXSURFACELib::exToolBarButtonHotForeColor,RGB(255,255,255));

91
How can I change the toolbar's background color

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutBackground(EXSURFACELib::exToolBarBackColor,RGB(255,255,255));

90
How can I fit or ensure that all elements are in the control's client area
/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element A",long(-500),long(-500))->PutBackColor(RGB(0,255,0));
	var_Elements->Add("Element B",long(500),long(500))->PutBackColor(RGB(255,0,0));
	var_Elements->Add("Element C",long(48),long(24));
spSurface1->FitToClient();

89
When I use the context menu to insert an image, the size seems to be fixed to 32 pixels. How can I control / change this

// CreateElement event - The user creates at runtime a new element.
void OnCreateElementSurface1(LPDISPATCH   Element)
{
	// Element.Edit(0,"multiline,wordwrap")
	// Element.AutoSize = True
	/*
		Copy and paste the following directives to your header file as
		it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'
		#import <ExSurface.dll>
		using namespace EXSURFACELib;
	*/
	EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
	OutputDebugStringW( L"Call Edit(0) method of the Element object" );
}

// RClick event - Occurs once the user right clicks the control.
void OnRClickSurface1()
{
	// SelElement(0).Edit(0,"multiline,wordwrap")
	EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
	spSurface1->PutSelection(((ObjectPtr)(spSurface1->GetElementFromPoint(-1,-1))));
	OutputDebugStringW( L"Call Edit(0) method of the SelElement(0) property" );
}

EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->GetVisualAppearance()->Add(1,"c:\\exontrol\\images\\normal.ebn");
spSurface1->GetVisualAppearance()->Add(3,"c:\\exontrol\\images\\hot.ebn");
spSurface1->PutBackground(EXSURFACELib::exContextMenuAppearance,0x1000000);
spSurface1->PutBackground(EXSURFACELib::exContextMenuSelBackColor,0x1fcddc0);
spSurface1->PutBackground(EXSURFACELib::exElementBorderColor,0x3000000);
spSurface1->PutSelectObjectColor(RGB(192,221,252));
spSurface1->PutHTMLPicture(L"pic1","c:\\exontrol\\images\\zipdisk.gif");
spSurface1->PutHTMLPicture(L"pic2","c:\\exontrol\\images\\auction.gif");
spSurface1->PutHTMLPicture(L"pic3","c:\\exontrol\\images\\colorize.gif");
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element A",vtMissing,vtMissing)->PutID("A");
	EXSURFACELib::IElementPtr var_Element = var_Elements->Add("Custom-size pictures:<br><img>pic1:24</img>,<img>pic2:48</img> ,... and so on.",long(96),long(48));
		var_Element->PutID("B");
		var_Element->PutCaptionSingleLine(EXSURFACELib::exCaptionWordWrap);
	var_Elements->Add("Element C",long(48),long(24));
spSurface1->PutEditContextMenuItems(_bstr_t("Size[id=57680][edittype=515][border=0][min=16][max=128][freq=16][editwidth=-128][ticklabel=value = %i ? '<b>'+value : ( value =") +
" vmax ? '<fgcolor 808080><font ;6><b>'+value : ( value = vmin ? '<fgcolor 808080><font ;6><b>'+value : '' ) )],Insert[group=3](<" +
"img>pic1:32</img>[id=57763],<img>pic2:32</img>[id=57763],Others[id=1000](default[group=3](<img>pic3</img>[id=57763]),<font ;6>ot" +
"her sizes[sep],<img>pic3:16</img>[id=57763],<img>pic3:32</img>[id=57763],<img>pic3:64</img>[id=57763]))");

88
Can I add images to node while editing the node using the Edit method

// CreateElement event - The user creates at runtime a new element.
void OnCreateElementSurface1(LPDISPATCH   Element)
{
	// Element.Edit(0,"multiline,wordwrap")
	// Element.AutoSize = True
	/*
		Copy and paste the following directives to your header file as
		it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'
		#import <ExSurface.dll>
		using namespace EXSURFACELib;
	*/
	EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
	OutputDebugStringW( L"Call Edit(0) method of the Element object" );
}

// RClick event - Occurs once the user right clicks the control.
void OnRClickSurface1()
{
	// SelElement(0).Edit(0,"multiline,wordwrap")
	EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
	spSurface1->PutSelection(((ObjectPtr)(spSurface1->GetElementFromPoint(-1,-1))));
	OutputDebugStringW( L"Call Edit(0) method of the SelElement(0) property" );
}

EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->GetVisualAppearance()->Add(1,"c:\\exontrol\\images\\normal.ebn");
spSurface1->PutBackground(EXSURFACELib::exContextMenuAppearance,0x1000000);
spSurface1->PutBackground(EXSURFACELib::exContextMenuSelBackColor,0x10000ff);
spSurface1->PutSelectObjectStyle(EXSURFACELib::exNoLines);
spSurface1->PutSelectObjectColor(RGB(192,221,252));
spSurface1->PutHTMLPicture(L"pic1","c:\\exontrol\\images\\zipdisk.gif");
spSurface1->PutHTMLPicture(L"pic2","c:\\exontrol\\images\\auction.gif");
spSurface1->Images(_bstr_t("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTq") +
"lVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m" +
"0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/y" +
"NAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=");
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element A",vtMissing,vtMissing)->PutID("A");
	EXSURFACELib::IElementPtr var_Element = var_Elements->Add("This is a node that displays pictures:<br><img>pic1:48</img>,<img>pic2:48</img> ,... and so on.",long(96),long(48));
		var_Element->PutID("B");
		var_Element->PutCaptionSingleLine(EXSURFACELib::exCaptionWordWrap);
	var_Elements->Add("Element C",long(48),long(24))->PutBackColor(RGB(255,255,255));

87
I am using the Edit method to edit the node, but still not able to display multiple lines. Is this possible

// CreateElement event - The user creates at runtime a new element.
void OnCreateElementSurface1(LPDISPATCH   Element)
{
	// Element.Edit(0,"multiline,wordwrap")
	// Element.AutoSize = True
	/*
		Copy and paste the following directives to your header file as
		it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'
		#import <ExSurface.dll>
		using namespace EXSURFACELib;
	*/
	EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
	OutputDebugStringW( L"Call Edit(0) method of the Element object" );
}

// RClick event - Occurs once the user right clicks the control.
void OnRClickSurface1()
{
	// SelElement(0).Edit(0,"multiline,wordwrap")
	EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
	spSurface1->PutSelection(((ObjectPtr)(spSurface1->GetElementFromPoint(-1,-1))));
	OutputDebugStringW( L"Call Edit(0) method of the SelElement(0) property" );
}

EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->GetVisualAppearance()->Add(1,"c:\\exontrol\\images\\normal.ebn");
spSurface1->PutBackground(EXSURFACELib::exContextMenuAppearance,0x1000000);
spSurface1->PutBackground(EXSURFACELib::exContextMenuSelBackColor,0x10000ff);
spSurface1->PutSelectObjectStyle(EXSURFACELib::exNoLines);
spSurface1->PutSelectObjectColor(RGB(192,221,252));
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element A",vtMissing,vtMissing)->PutID("A");
	EXSURFACELib::IElementPtr var_Element = var_Elements->Add("Right-<b>Click</b> the node to edit it.",long(96),long(48));
		var_Element->PutID("B");
		var_Element->PutCaptionSingleLine(EXSURFACELib::exCaptionWordWrap);
	var_Elements->Add("Element C",long(48),long(24))->PutBackColor(RGB(255,255,255));

86
How can I change the visual appearance of the edit's context menu

// CreateElement event - The user creates at runtime a new element.
void OnCreateElementSurface1(LPDISPATCH   Element)
{
	// Element.Edit(0)
	// Element.AutoSize = True
	/*
		Copy and paste the following directives to your header file as
		it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'
		#import <ExSurface.dll>
		using namespace EXSURFACELib;
	*/
	EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
	OutputDebugStringW( L"Call Edit(0) method of the Element object" );
}

// RClick event - Occurs once the user right clicks the control.
void OnRClickSurface1()
{
	// SelElement(0).Edit(0)
	EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
	spSurface1->PutSelection(((ObjectPtr)(spSurface1->GetElementFromPoint(-1,-1))));
	OutputDebugStringW( L"Call Edit(0) method of the SelElement(0) property" );
}

EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->GetVisualAppearance()->Add(1,"c:\\exontrol\\images\\normal.ebn");
spSurface1->PutBackground(EXSURFACELib::exContextMenuAppearance,0x1000000);
spSurface1->PutBackground(EXSURFACELib::exContextMenuSelBackColor,0x10000ff);
spSurface1->PutSelectObjectStyle(EXSURFACELib::exNoLines);
spSurface1->PutSelectObjectColor(RGB(192,221,252));
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element A",vtMissing,vtMissing)->PutID("A");
	var_Elements->Add("Right-Click to edit this node",long(96),long(48))->PutID("B");
	var_Elements->Add("Element C",long(48),long(24))->PutBackColor(RGB(255,255,255));

85
How can I edit the node once the user right-click the element

// CreateElement event - The user creates at runtime a new element.
void OnCreateElementSurface1(LPDISPATCH   Element)
{
	// Element.Edit(0)
	// Element.AutoSize = True
	/*
		Copy and paste the following directives to your header file as
		it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'
		#import <ExSurface.dll>
		using namespace EXSURFACELib;
	*/
	EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
	OutputDebugStringW( L"Call Edit(0) method of the Element object" );
}

// RClick event - Occurs once the user right clicks the control.
void OnRClickSurface1()
{
	// SelElement(0).Edit(0)
	EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
	spSurface1->PutSelection(((ObjectPtr)(spSurface1->GetElementFromPoint(-1,-1))));
	OutputDebugStringW( L"Call Edit(0) method of the SelElement(0) property" );
}

EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element A",vtMissing,vtMissing)->PutID("A");
	var_Elements->Add("Element B",long(96),long(48))->PutID("B");
	var_Elements->Add("Element C",long(48),long(24))->PutBackColor(RGB(255,255,255));

84
I wish to return the name that is displayed in the Element that I have selected

// SelectionChanged event - Notifies your application that the control's selection has been changed.
void OnSelectionChangedSurface1()
{
	/*
		Copy and paste the following directives to your header file as
		it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'
		#import <ExSurface.dll>
		using namespace EXSURFACELib;
	*/
	EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
	OutputDebugStringW( L"The number of selected elements is: " );
	OutputDebugStringW( _bstr_t(spSurface1->GetSelCount()) );
	OutputDebugStringW( spSurface1->GetSelElement(0)->GetCaption() );
}

EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutHideSel(VARIANT_FALSE);
spSurface1->PutSelectObjectColorInactive(spSurface1->GetSelectObjectColor());
spSurface1->PutSelectObjectTextColorInactive(spSurface1->GetSelectObjectTextColor());
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element 1",vtMissing,vtMissing)->PutSelected(VARIANT_TRUE);
	EXSURFACELib::IElementPtr var_Element = var_Elements->Add("Element 2",vtMissing,vtMissing);
		var_Element->PutX(32);
		var_Element->PutY(32);

83
Been playing with the surface control with the embedded ExGrid ActiveX...I can see most events coming through via the Surface control but I can't get the OnOLEStartDrag event to fire

// OleEvent event - Occurs once an inside control fires an event.
void OnOleEventSurface1(LPDISPATCH   Element,LPDISPATCH   Ev)
{
	// Ev.Param(1).Value = 2
	// Ev.Param(0).Value.SetData("items to be carried")
	/*
		Copy and paste the following directives to your header file as
		it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'
		#import <ExSurface.dll>
		using namespace EXSURFACELib;
	*/
	EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
	OutputDebugStringW( L"Ev" );
}

EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->BeginUpdate();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	EXSURFACELib::IElementPtr var_Element = var_Elements->InsertControl("Exontrol.Grid",vtMissing,vtMissing,vtMissing);
		var_Element->PutElementFormat(L"\"client\"");
		ObjectPtr var_Object = var_Element->GetObject();
spSurface1->MoveCorner(EXSURFACELib::exMiddleCenter,EXSURFACELib::exTopLeft);
spSurface1->EndUpdate();

82
Is it possible to assign/add a percent to an element

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	EXSURFACELib::IElementPtr var_Element = var_Elements->Add("Element A",vtMissing,vtMissing);
		var_Element->PutID("A");
		var_Element->PutCaptionAlign(EXSURFACELib::exTopCenter);
		var_Element->PutAutoSize(VARIANT_FALSE);
		var_Element->PutHeight(36);
		var_Element->PutWidth(96);
		var_Element->PutMinHeight(36);
		var_Element->PutBackgroundExt(L"none[(2,100%-15,100%-4,14)](left[50%,back=RGB(0,255,0),text=`15%`,align=0x11,pattern=6,frame])");
		var_Element->PutBackgroundExtValue(EXSURFACELib::exIndexExt2,EXSURFACELib::exClientExt,"75%");
		var_Element->PutBackgroundExtValue(EXSURFACELib::exIndexExt2,EXSURFACELib::exTextExt,var_Element->GetBackgroundExtValue(EXSURFACELib::exIndexExt2,EXSURFACELib::exClientExt));

81
How can I disable selecting the nodes/elements
/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutAllowSelectObject(EXSURFACELib::exDisallow);
spSurface1->PutAllowSelectNothing(VARIANT_FALSE);
spSurface1->PutAllowSelectObjectRect(EXSURFACELib::exDisallow);
spSurface1->PutAllowToggleSelectKey(EXSURFACELib::exDisallow);

80
How can I set my zooming levels on the control's toolbar

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutZoomLevels(L"75,100,150,200");
spSurface1->PutAllowLinkObjects(EXSURFACELib::exDisallow);
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element A",vtMissing,vtMissing)->PutID("A");
	var_Elements->Add("Element B",long(96),long(24))->PutID("B");
	var_Elements->Add("Element C",long(48),long(12))->PutBackColor(RGB(255,255,255));

79
How can I prevent zooming the surface

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutAllowZoomSurface(EXSURFACELib::exDisallow);
spSurface1->PutAllowZoomWheelSurface(VARIANT_FALSE);
spSurface1->PutToolBarFormat(L"-1,100");

78
How can I prevent adding the links
/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutAllowLinkObjects(EXSURFACELib::exDisallow);
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element A",vtMissing,vtMissing)->PutID("A");
	var_Elements->Add("Element B",long(96),long(24))->PutID("B");
	var_Elements->Add("Element C",long(48),long(12))->PutBackColor(RGB(255,255,255));

77
How can I fix all elements on the surface, so no moving or resizing is allowed

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutAllowResizeObject(EXSURFACELib::exDisallow);
spSurface1->PutAllowMoveObject(EXSURFACELib::exDisallow);
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element A",vtMissing,vtMissing)->PutID("A");
	var_Elements->Add("Element B",long(96),long(24))->PutID("B");
	var_Elements->Add("Element C",long(48),long(12))->PutBackColor(RGB(255,255,255));

76
How can I link elements with no pressing the SHIFT key
/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutAllowInsertObject(VARIANT_FALSE);
spSurface1->PutAllowLinkObjects(EXSURFACELib::exLeftClick);
spSurface1->PutAllowMoveObject(EXSURFACELib::exDisallow);
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element A",vtMissing,vtMissing)->PutID("A");
	var_Elements->Add("Element B",long(96),long(24))->PutID("B");
	var_Elements->Add("Element C",long(48),long(12))->PutBackColor(RGB(255,255,255));

75
How can I disable creating the tree/hierarchies
/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutAllowInsertObject(VARIANT_FALSE);
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element A",vtMissing,vtMissing)->PutID("A");
	var_Elements->Add("Element B",long(96),long(24))->PutID("B");
	var_Elements->Add("Element C",long(48),long(12))->PutBackColor(RGB(255,255,255));

74
How can I create new elements using simple clicks rather than double clicks

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutAllowCreateObject(EXSURFACELib::exLeftClick);

73
How can I disable creating new elements at runtime
/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutAllowCreateObject(EXSURFACELib::exDisallow);

72
I've noticed that the links cut the elements. Is it possible to show the links on the back

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutShowLinksType(EXSURFACELib::exLinkStraight);
spSurface1->PutShowLinks(EXSURFACELib::exShowExtendedLinks);
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element A",vtMissing,vtMissing)->PutID("A");
	var_Elements->Add("Element B",long(96),long(24))->PutID("B");
	var_Elements->Add("Element C",long(48),long(12))->PutBackColor(RGB(255,255,255));
EXSURFACELib::ILinksPtr var_Links = spSurface1->GetLinks();
	var_Links->Add(spSurface1->GetElements()->GetItem("A"),spSurface1->GetElements()->GetItem("B"),vtMissing)->PutCaption(L"link");

71
How can I show a picture on the link

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutHTMLPicture(L"pic1","c:\\exontrol\\images\\zipdisk.gif");
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element A",vtMissing,vtMissing)->PutID("A");
	var_Elements->Add("Element B",long(96),long(24))->PutID("B");
EXSURFACELib::ILinksPtr var_Links = spSurface1->GetLinks();
	var_Links->Add(spSurface1->GetElements()->GetItem("A"),spSurface1->GetElements()->GetItem("B"),vtMissing)->PutCaption(L"<img>pic1:24</img>");
spSurface1->PutShowLinksType(EXSURFACELib::exLinkStraight);

70
How can I show a caption on the link

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element A",vtMissing,vtMissing)->PutID("A");
	var_Elements->Add("Element B",long(96),long(24))->PutID("B");
EXSURFACELib::ILinksPtr var_Links = spSurface1->GetLinks();
	var_Links->Add(spSurface1->GetElements()->GetItem("A"),spSurface1->GetElements()->GetItem("B"),vtMissing)->PutCaption(L"link");
spSurface1->PutShowLinksType(EXSURFACELib::exLinkStraight);

69
I am using EBN to show my arrows, the question is if I can make it bigger/larger

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IAppearancePtr var_Appearance = spSurface1->GetVisualAppearance();
	var_Appearance->Add(1,"c:\\exontrol\\images\\normal.ebn");
	var_Appearance->Add(2,"CP:1 -2 -2 2 2");
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element A",vtMissing,vtMissing)->PutID("A");
	var_Elements->Add("Element B",long(96),long(24))->PutID("B");
	var_Elements->Add("Element C",long(96),long(-24))->PutID("C");
EXSURFACELib::ILinksPtr var_Links = spSurface1->GetLinks();
	var_Links->Add(spSurface1->GetElements()->GetItem("A"),spSurface1->GetElements()->GetItem("B"),vtMissing);
	var_Links->Add(spSurface1->GetElements()->GetItem("A"),spSurface1->GetElements()->GetItem("C"),vtMissing);
spSurface1->PutLinksArrowColor(0x2000000);

68
Is it possible to show different type of arrows for links

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->GetVisualAppearance()->Add(1,"c:\\exontrol\\images\\normal.ebn");
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element A",vtMissing,vtMissing)->PutID("A");
	var_Elements->Add("Element B",long(96),long(24))->PutID("B");
	var_Elements->Add("Element C",long(96),long(-24))->PutID("C");
EXSURFACELib::ILinksPtr var_Links = spSurface1->GetLinks();
	var_Links->Add(spSurface1->GetElements()->GetItem("A"),spSurface1->GetElements()->GetItem("B"),vtMissing)->PutArrowColor(RGB(255,0,0));
	var_Links->Add(spSurface1->GetElements()->GetItem("A"),spSurface1->GetElements()->GetItem("C"),vtMissing)->PutArrowColor(0x1000000);

67
How can I remove or clear the entire surface
/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->GetElements()->Add("element",vtMissing,vtMissing);
spSurface1->GetElements()->Clear();
spSurface1->Home();

66
How can I programmatically add a child element, or create a tree/hierarchy

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Root",vtMissing,vtMissing)->PutID("rootID");
	var_Elements->Insert("Child 1","rootID",vtMissing);
	var_Elements->Insert("Child 2","rootID",vtMissing)->PutID("childID");
	var_Elements->Insert("Child 3","rootID",vtMissing);
	var_Elements->Insert("Sub-Child 1.2","childID",vtMissing);
	var_Elements->Insert("Sub-Child 2.2","childID",vtMissing);

65
I've noticed that the element's background is transparent. Can I make it opaque

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("new 1",vtMissing,vtMissing)->PutBackColor(RGB(255,255,255));
	var_Elements->Add("new 1",long(24),long(24))->PutBackColor(RGB(240,240,240));

64
How can I add a resizable element
/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	EXSURFACELib::IElementPtr var_Element = var_Elements->Add("new 1",vtMissing,vtMissing);
		var_Element->PutAutoSize(VARIANT_FALSE);
		var_Element->PutResizable(VARIANT_TRUE);
	EXSURFACELib::IElementPtr var_Element1 = var_Elements->Add("new 1",long(24),long(24));
		var_Element1->PutAutoSize(VARIANT_FALSE);
		var_Element1->PutResizable(VARIANT_TRUE);

63
How can I programmatically add a new element

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("new 1",vtMissing,vtMissing);
	var_Elements->Add("new 1",long(24),long(24));

62
Is it possible to assign a tooltip to an element

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->GetElements()->Add("Element with a Tooltip",vtMissing,vtMissing)->PutToolTip(L"This is a bit of text that should be displayed when cursor hovers the element.");

61
How do I specify direct/straight link for all links

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutShowLinksType(EXSURFACELib::ShowLinkTypeEnum(EXSURFACELib::exLinkStraight | EXSURFACELib::exLinkDirect));
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element <sha ;;0>A",vtMissing,vtMissing);
	var_Elements->Add("Element <sha ;;0>B",long(96),long(24));
EXSURFACELib::ILinksPtr var_Links = spSurface1->GetLinks();
	var_Links->Add(spSurface1->GetElements()->GetItem(long(1)),spSurface1->GetElements()->GetItem(long(2)),vtMissing);

60
How do I show a direct/straight link

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element <sha ;;0>A",vtMissing,vtMissing);
	var_Elements->Add("Element <sha ;;0>B",long(96),long(24));
EXSURFACELib::ILinksPtr var_Links = spSurface1->GetLinks();
	var_Links->Add(spSurface1->GetElements()->GetItem(long(1)),spSurface1->GetElements()->GetItem(long(2)),vtMissing)->PutShowLinkType(EXSURFACELib::ShowLinkTypeEnum(EXSURFACELib::exLinkStraight | EXSURFACELib::exLinkDirect));

59
How can I ensure that a specified element fits the surface's visible area

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	EXSURFACELib::IPatternPtr var_Pattern = var_Elements->Add("Element A",long(-100),vtMissing)->GetPattern();
		var_Pattern->PutType(EXSURFACELib::exPatternBDiagonal);
		var_Pattern->PutColor(RGB(224,224,224));
	var_Elements->Add("Element B",long(2000),vtMissing)->ScrollTo(EXSURFACELib::exMiddleCenter);

58
Is it possible to show a pattern like ( not available ) over an element

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	EXSURFACELib::IPatternPtr var_Pattern = var_Elements->Add("Element+Pattern",long(-100),vtMissing)->GetPattern();
		var_Pattern->PutType(EXSURFACELib::exPatternBDiagonal);
		var_Pattern->PutColor(RGB(224,224,224));
	var_Elements->Add("Element",long(100),vtMissing);

57
How can I specify a different overview color for the element

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element+A",long(-100),vtMissing)->PutOverviewColor(RGB(255,0,0));
	var_Elements->Add("Element+B",long(100),vtMissing);
spSurface1->PutScrollPos(VARIANT_TRUE,512);

56
I've noticed that some lines are shown on the border, how can I get ride of them

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element+A",long(-100),vtMissing);
	var_Elements->Add("Element+B",long(100),vtMissing);
spSurface1->PutScrollPos(VARIANT_TRUE,512);
spSurface1->PutOverviewColor(-1);

55
How can I handle clicking an icon or a picture

// HandCursorClick event - The uses clicks a part of the element that shows the had cursor.
void OnHandCursorClickSurface1(LPDISPATCH   Element,long   Hit,VARIANT   Key)
{
	/*
		Copy and paste the following directives to your header file as
		it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'
		#import <ExSurface.dll>
		using namespace EXSURFACELib;
	*/
	EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
	OutputDebugStringW( L"Key" );
}

EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->Images(_bstr_t("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTq") +
"lVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m" +
"0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/y" +
"NAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=");
spSurface1->PutHTMLPicture(L"pic1","c:\\exontrol\\images\\zipdisk.gif");
spSurface1->PutHTMLPicture(L"pic2","c:\\exontrol\\images\\auction.gif");
EXSURFACELib::IElementPtr var_Element = spSurface1->GetElements()->Add("Caption",vtMissing,vtMissing);
	var_Element->PutPictures(L"1,2/pic1/pic2");
	var_Element->PutPicturesAlign(EXSURFACELib::exBottomCenter);
	var_Element->PutShowHandCursorOn(EXSURFACELib::ShowHandCursorOnEnum(EXSURFACELib::exShowHandCursorExtraPictures | EXSURFACELib::exShowHandCursorPictures | EXSURFACELib::exShowHandCursorIcon | EXSURFACELib::exShowHandCursorPicture));
	var_Element->PutCaptionAlign(EXSURFACELib::exTopCenter);

54
How can I display a picture

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutHTMLPicture(L"pic1","c:\\exontrol\\images\\zipdisk.gif");
spSurface1->PutHTMLPicture(L"pic2","c:\\exontrol\\images\\auction.gif");
spSurface1->GetElements()->Add("Element",vtMissing,vtMissing)->PutPictures(L"pic1/pic2");

53
How can I display a picture

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutHTMLPicture(L"pic1","c:\\exontrol\\images\\zipdisk.gif");
spSurface1->PutHTMLPicture(L"pic2","c:\\exontrol\\images\\auction.gif");
spSurface1->GetElements()->Add("Icon <img>pic1</img> or <img>pic2</img>",vtMissing,vtMissing);

52
How can I display an icon

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->Images(_bstr_t("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTq") +
"lVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m" +
"0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/y" +
"NAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=");
spSurface1->GetElements()->Add("Element",vtMissing,vtMissing)->PutPictures(L"0/1,2");

51
How can I display an icon

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->Images(_bstr_t("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTq") +
"lVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m" +
"0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/y" +
"NAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=");
spSurface1->GetElements()->Add("Icon <img>1</img> or <img>2</img>",vtMissing,vtMissing);

50
How can I prevent moving all descendent/outgoing elements when focused element is moved, more like a free move
/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element <sha ;;0>A",vtMissing,vtMissing);
	var_Elements->Add("Element <sha ;;0>B",long(96),long(24));
EXSURFACELib::ILinksPtr var_Links = spSurface1->GetLinks();
	var_Links->Add(spSurface1->GetElements()->GetItem(long(1)),spSurface1->GetElements()->GetItem(long(2)),vtMissing);
spSurface1->PutShowLinksType(EXSURFACELib::ShowLinkTypeEnum(EXSURFACELib::exLinkStraight | EXSURFACELib::exLinkDirect));
spSurface1->PutAllowMoveDescendents(VARIANT_FALSE);

49
How can I display the +/- expand/collapse glyphs next to linked elements

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element <sha ;;0>A",vtMissing,vtMissing);
	var_Elements->Add("Element <sha ;;0>B",long(96),long(24));
EXSURFACELib::ILinksPtr var_Links = spSurface1->GetLinks();
	var_Links->Add(spSurface1->GetElements()->GetItem(long(1)),spSurface1->GetElements()->GetItem(long(2)),vtMissing);
spSurface1->GetElements()->GetItem(long(1))->PutExpanded(VARIANT_FALSE);
spSurface1->PutExpandLinkedElements(VARIANT_TRUE);

48
How can I host the Exontrol.Button inside the surface

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	EXSURFACELib::IElementPtr var_Element = var_Elements->Add("ActiveX",vtMissing,vtMissing);
		var_Element->PutType(EXSURFACELib::exElementHostControl);
		var_Element->PutElementFormat(L"\"check\":18,\"client\"");
		var_Element->PutShowCheckBox(VARIANT_TRUE);
		var_Element->PutControl(L"Exontrol.Button");
		/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXBUTTONLib' for the library: 'ExButton 1.0 Control Library'

	#import <ExButton.dll>
	using namespace EXBUTTONLib;
*/
		((EXBUTTONLib::IButtonPtr)(var_Element->GetObject()))->PutCaption(L"<sha ;;0>button");
		var_Element->PutHeight(32);
		var_Element->PutWidth(128);

47
How can I host a Command button

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	EXSURFACELib::IElementPtr var_Element = var_Elements->InsertControl("Forms.CommandButton.1",vtMissing,vtMissing,vtMissing);
		var_Element->PutElementFormat(L"\"check\":18,\"client\"");
		/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'MSForms' for the library: 'Microsoft Forms 2.0 Object Library'

	#import <FM20.DLL>
*/
		((MSForms::ICommandButtonPtr)(var_Element->GetObject()))->PutCaption(L"command");
		var_Element->PutShowCheckBox(VARIANT_TRUE);
		var_Element->PutHeight(48);
		var_Element->PutWidth(128);

46
How can I handle the events of the inner ActiveX control

// OleEvent event - Occurs once an inside control fires an event.
void OnOleEventSurface1(LPDISPATCH   Element,LPDISPATCH   Ev)
{
	/*
		Copy and paste the following directives to your header file as
		it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'
		#import <ExSurface.dll>
		using namespace EXSURFACELib;
	*/
	EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
	OutputDebugStringW( L"Ev" );
}

EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	EXSURFACELib::IElementPtr var_Element = var_Elements->InsertControl("Forms.CommandButton.1",vtMissing,vtMissing,vtMissing);
		var_Element->PutElementFormat(L"\"check\":18,\"client\"");
		/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'MSForms' for the library: 'Microsoft Forms 2.0 Object Library'

	#import <FM20.DLL>
*/
		((MSForms::ICommandButtonPtr)(var_Element->GetObject()))->PutCaption(L"command");
		var_Element->PutShowCheckBox(VARIANT_TRUE);
		var_Element->PutHeight(48);
		var_Element->PutWidth(128);

45
How can I display a checkbox while my node hosts an ActiveX inside

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	EXSURFACELib::IElementPtr var_Element = var_Elements->InsertControl("Forms.CommandButton.1",vtMissing,vtMissing,vtMissing);
		var_Element->PutElementFormat(L"\"check\":18,\"client\"");
		/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'MSForms' for the library: 'Microsoft Forms 2.0 Object Library'

	#import <FM20.DLL>
*/
		((MSForms::ICommandButtonPtr)(var_Element->GetObject()))->PutCaption(L"command");
		var_Element->PutShowCheckBox(VARIANT_TRUE);
		var_Element->PutHeight(48);
		var_Element->PutWidth(128);

44
Is it possible to display a caption while the element hosts an ActiveX control

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	EXSURFACELib::IElementPtr var_Element = var_Elements->InsertControl("Forms.CommandButton.1",vtMissing,vtMissing,vtMissing);
		var_Element->PutElementFormat(L"18;\"caption\"/\"client\"");
		/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'MSForms' for the library: 'Microsoft Forms 2.0 Object Library'

	#import <FM20.DLL>
*/
		((MSForms::ICommandButtonPtr)(var_Element->GetObject()))->PutCaption(L"command");
		var_Element->PutCaption(L"Forms.CommandButton");
		var_Element->PutCaptionAlign(EXSURFACELib::exTopCenter);
		var_Element->PutHeight(48);
		var_Element->PutWidth(128);

43
I host an ActiveX control but it does not cover the whole element. What can be done

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	EXSURFACELib::IElementPtr var_Element = var_Elements->InsertControl("Forms.CommandButton.1",vtMissing,vtMissing,vtMissing);
		var_Element->PutElementFormat(L"\"client\"");
		/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'MSForms' for the library: 'Microsoft Forms 2.0 Object Library'

	#import <FM20.DLL>
*/
		((MSForms::ICommandButtonPtr)(var_Element->GetObject()))->PutCaption(L"command");
		var_Element->PutHeight(32);
		var_Element->PutWidth(128);
	EXSURFACELib::IElementPtr var_Element1 = var_Elements->InsertControl("Forms.CommandButton.1",vtMissing,vtMissing,vtMissing);
		var_Element1->PutElementFormat(L"\"client\"");
		((MSForms::ICommandButtonPtr)(var_Element1->GetObject()))->PutCaption(L"command");
		var_Element1->PutHeight(32);
		var_Element1->PutWidth(128);

42
How can I host my ActiveX to the surface (method 2)

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	EXSURFACELib::IElementPtr var_Element = var_Elements->InsertControl("Forms.CommandButton.1",vtMissing,vtMissing,vtMissing);
		var_Element->PutElementFormat(L"\"client\"");
		/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'MSForms' for the library: 'Microsoft Forms 2.0 Object Library'

	#import <FM20.DLL>
*/
		((MSForms::ICommandButtonPtr)(var_Element->GetObject()))->PutCaption(L"command");
		var_Element->PutHeight(32);
		var_Element->PutWidth(128);

41
How can I host my ActiveX to the surface (method 1)

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	EXSURFACELib::IElementPtr var_Element = var_Elements->Add("ActiveX",vtMissing,vtMissing);
		var_Element->PutType(EXSURFACELib::exElementHostControl);
		var_Element->PutElementFormat(L"\"client\"");
		var_Element->PutControl(L"Forms.CommandButton.1");
		/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'MSForms' for the library: 'Microsoft Forms 2.0 Object Library'

	#import <FM20.DLL>
*/
		((MSForms::ICommandButtonPtr)(var_Element->GetObject()))->PutCaption(L"command");
		var_Element->PutHeight(32);
		var_Element->PutWidth(128);

40
How can I define the elements with a solid color on the background

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutBackground(EXSURFACELib::exElementBorderColor,-1);
spSurface1->PutBackground(EXSURFACELib::exElementStatusColor,-1);
spSurface1->PutBackground(EXSURFACELib::exElementBackColor,RGB(255,0,0));
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Node A",vtMissing,vtMissing);
	var_Elements->Add("Node B",long(96),long(24));

39
Can I display the status to a different part of the element

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->GetElements()->Add("Node",vtMissing,vtMissing)->PutStatusAlign(EXSURFACELib::exAlignBottom);

38
How can I remove or hide the status part of the event

// AddElement event - A new element has been added to the surface.
void OnAddElementSurface1(LPDISPATCH   Element)
{
	// Element.StatusSize = 0
}

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutBackground(EXSURFACELib::exElementStatusColor,-1);
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Node A",vtMissing,vtMissing);
	var_Elements->Add("Node B",long(96),long(24));

37
How can I change the visual appearance of the border for all elements

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->GetVisualAppearance()->Add(1,"c:\\exontrol\\images\\normal.ebn");
spSurface1->PutBackground(EXSURFACELib::exElementBorderColor,0x1000000);
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element+A",vtMissing,vtMissing);
	var_Elements->Add("Element+B",long(96),long(24));

36
How can I change the color of the border for all elements

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutBackground(EXSURFACELib::exElementBorderColor,RGB(0,255,0));
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element+A",vtMissing,vtMissing);
	var_Elements->Add("Element+B",long(96),long(24));

35
How can I remove the border for all elements

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutBackground(EXSURFACELib::exElementBorderColor,-1);
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element+A",vtMissing,vtMissing);
	var_Elements->Add("Element+B",long(96),long(24));

34
How do I change the visual appearance the glpyh that shows when the element is added as a child

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->GetVisualAppearance()->Add(1,"c:\\exontrol\\images\\normal.ebn");
spSurface1->GetVisualAppearance()->Add(2,"c:\\exontrol\\images\\pushed.ebn");
spSurface1->PutBackground(EXSURFACELib::exHoverInsertObject,0x1000000);
spSurface1->PutBackground(EXSURFACELib::exHoverInsertObjectGlyph,0x2000000);
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element <sha ;;0>A",vtMissing,vtMissing);
	var_Elements->Add("Element <sha ;;0>B",long(96),long(24));

33
Is it possible to change the color for the glpyh that shows when the element is added as a child

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutBackground(EXSURFACELib::exHoverInsertObject,RGB(255,0,0));
spSurface1->PutBackground(EXSURFACELib::exHoverInsertObjectGlyph,RGB(255,0,0));
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element <sha ;;0>A",vtMissing,vtMissing);
	var_Elements->Add("Element <sha ;;0>B",long(96),long(24));

32
How can I change the color to show a valid link

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutBackground(EXSURFACELib::exLinkObjectsValidColor,RGB(0,255,0));
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element <sha ;;0>A",vtMissing,vtMissing);
	var_Elements->Add("Element <sha ;;0>B",long(96),long(24));

31
How can I change the color to show an invalid link

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutBackground(EXSURFACELib::exLinkObjectsInvalidColor,RGB(0,255,0));
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element <sha ;;0>A",vtMissing,vtMissing);
	var_Elements->Add("Element <sha ;;0>B",long(96),long(24));

30
How can I disable adding the elements as child of other nodes
/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutAllowInsertObject(VARIANT_FALSE);
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element <sha ;;0>A",vtMissing,vtMissing);
	var_Elements->Add("Element <sha ;;0>B",long(96),long(24));

29
How can I prevent moving the outgoing /descendents elements when moving an element
/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutShowLinksType(EXSURFACELib::ShowLinkTypeEnum(EXSURFACELib::exLinkStraight | EXSURFACELib::exLinkDirect));
spSurface1->PutAllowMoveDescendents(VARIANT_FALSE);
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element <sha ;;0>A",vtMissing,vtMissing);
	var_Elements->Add("Element <sha ;;0>B",long(96),long(24));
EXSURFACELib::ILinksPtr var_Links = spSurface1->GetLinks();
	var_Links->Add(spSurface1->GetElements()->GetItem(long(1)),spSurface1->GetElements()->GetItem(long(2)),vtMissing);

28
How can I add programatically a link

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element <sha ;;0>A",vtMissing,vtMissing);
	var_Elements->Add("Element <sha ;;0>B",long(96),long(24));
EXSURFACELib::ILinksPtr var_Links = spSurface1->GetLinks();
	var_Links->Add(spSurface1->GetElements()->GetItem(long(1)),spSurface1->GetElements()->GetItem(long(2)),vtMissing);

27
How do I prevent adding a link between elements
/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutAllowLinkObjects(EXSURFACELib::exDisallow);
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("Element <sha ;;0>A",vtMissing,vtMissing);
	var_Elements->Add("Element <sha ;;0>B",long(96),long(24));

26
How can I hide the 100% button ( zoom ) on the control's toolbar

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutToolBarFormat(L"-1,100");

25
Is it possible to hide the Home button on the control's toolbar

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutToolBarFormat(L"-1,101");

24
How can I hide the grid lines, including the axis

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutShowGridLines(VARIANT_FALSE);
spSurface1->PutAxisStyle(EXSURFACELib::exNoLines);

23
How can I hide the grid lines

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutShowGridLines(VARIANT_FALSE);

22
How can I clear the images shown on the control's toolbar

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->ToolBarReplaceIcon(long(0),long(-1));
spSurface1->ToolBarRefresh();

21
How can I replace the default icons shown on the control's toolbar

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->ToolBarReplaceIcon(long(0),long(-1));
spSurface1->ToolBarImages(_bstr_t("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTq") +
"lVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m" +
"0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/y" +
"NAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=");

20
How can I replace the default icons shown on the control's toolbar

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->ToolBarImages(_bstr_t("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTq") +
"lVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m" +
"0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/y" +
"NAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=");
spSurface1->PutToolBarCaption(100,L"<img>3</img> aka1");

19
How can I add an anchor element to the control's toolbar

// ToolBarAnchorClick event - Occurs when an anchor element is clicked, on the control's toolbar.
void OnToolBarAnchorClickSurface1(LPCTSTR   AnchorID,LPCTSTR   Options)
{
	/*
		Copy and paste the following directives to your header file as
		it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'
		#import <ExSurface.dll>
		using namespace EXSURFACELib;
	*/
	EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
	OutputDebugStringW( L"AnchorID" );
}

EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutToolBarFormat(L"-1,100,101,|,102");
spSurface1->PutToolBarCaption(102,L"<a a1>anchor</a>");

18
How can I add a button/image to the control's toolbar

// ToolBarClick event - Occurs when the user clicks a button in the toolbar.
void OnToolBarClickSurface1(long   ID,long   SelectedID)
{
	/*
		Copy and paste the following directives to your header file as
		it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'
		#import <ExSurface.dll>
		using namespace EXSURFACELib;
	*/
	EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
	OutputDebugStringW( L"ID" );
}

EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->ToolBarImages(_bstr_t("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTq") +
"lVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m" +
"0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/y" +
"NAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=");
spSurface1->PutToolBarFormat(L"-1,100,101,102");
spSurface1->PutToolBarCaption(102,L"<img>3</img> new");

17
How can I add a button to the control's toolbar

// ToolBarClick event - Occurs when the user clicks a button in the toolbar.
void OnToolBarClickSurface1(long   ID,long   SelectedID)
{
	/*
		Copy and paste the following directives to your header file as
		it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'
		#import <ExSurface.dll>
		using namespace EXSURFACELib;
	*/
	EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
	OutputDebugStringW( L"ID" );
}

EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutToolBarFormat(L"-1,100,101,102");
spSurface1->PutToolBarCaption(102,L"<sha ;;0>new");

16
How can I hide the control's toolbar

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutToolBarVisible(VARIANT_FALSE);

15
How can I prevent selecting the elements
/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutAllowSelectObject(EXSURFACELib::exDisallow);
spSurface1->PutAllowSelectObjectRect(EXSURFACELib::exDisallow);
spSurface1->PutAllowToggleSelectKey(EXSURFACELib::exDisallow);
spSurface1->GetElements()->Add("element",vtMissing,vtMissing);

14
How can I show the selected elements the same as the control has the focus

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutHideSel(VARIANT_FALSE);
spSurface1->PutSelectObjectColorInactive(spSurface1->GetSelectObjectColor());
spSurface1->PutSelectObjectTextColorInactive(spSurface1->GetSelectObjectTextColor());
spSurface1->GetElements()->Add("element",vtMissing,vtMissing)->PutSelected(VARIANT_TRUE);

13
How can I show the selected elements with a different border

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->GetVisualAppearance()->Add(1,"c:\\exontrol\\images\\normal.ebn");
spSurface1->PutHideSel(VARIANT_FALSE);
spSurface1->PutSelectObjectStyle(EXSURFACELib::exLinesSolid);
spSurface1->PutSelectObjectColor(0x1000000);
spSurface1->PutSelectObjectTextColor(RGB(0,0,0));
spSurface1->PutSelectObjectColorInactive(spSurface1->GetSelectObjectColor());
spSurface1->PutSelectObjectTextColorInactive(spSurface1->GetSelectObjectTextColor());
spSurface1->GetElements()->Add("element",vtMissing,vtMissing)->PutSelected(VARIANT_TRUE);

12
How can I show the selected elements with a different background color

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutHideSel(VARIANT_FALSE);
spSurface1->PutSelectObjectStyle(EXSURFACELib::exNoLines);
spSurface1->PutSelectObjectColor(RGB(255,0,0));
spSurface1->PutSelectObjectTextColor(RGB(255,255,255));
spSurface1->PutSelectObjectColorInactive(spSurface1->GetSelectObjectColor());
spSurface1->PutSelectObjectTextColorInactive(spSurface1->GetSelectObjectTextColor());
spSurface1->GetElements()->Add("element",vtMissing,vtMissing)->PutSelected(VARIANT_TRUE);

11
Is it possible to add an inner control on the surface

// OleEvent event - Occurs once an inside control fires an event.
void OnOleEventSurface1(LPDISPATCH   Element,LPDISPATCH   Ev)
{
	/*
		Copy and paste the following directives to your header file as
		it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'
		#import <ExSurface.dll>
		using namespace EXSURFACELib;
	*/
	EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
	OutputDebugStringW( L"Ev" );
}

EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	EXSURFACELib::IElementPtr var_Element = var_Elements->Add("activex hosting",vtMissing,vtMissing);
		var_Element->PutType(EXSURFACELib::exElementHostControl);
		var_Element->PutControl(L"Forms.CommandButton.1");
		var_Element->PutCaption(L"Command Button");
		var_Element->PutHeight(64);
		var_Element->PutWidth(128);
		var_Element->PutElementFormat(L"14;\"caption\"/\"client\"");
		var_Element->PutCaptionAlign(EXSURFACELib::exTopCenter);

10
How can I make the control read-only
// LayoutStartChanging event - Occurs when the control's layout is about to be changed.
void OnLayoutStartChangingSurface1(long   Operation)
{
	/*
		Copy and paste the following directives to your header file as
		it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'
		#import <ExSurface.dll>
		using namespace EXSURFACELib;
	*/
	EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
	OutputDebugStringW( L"Operation" );
	spSurface1->CancelLayoutChanging();
}

EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("new element",vtMissing,vtMissing);

9
How can I handle clicking a picture on the element

// HandCursorClick event - The uses clicks a part of the element that shows the had cursor.
void OnHandCursorClickSurface1(LPDISPATCH   Element,long   Hit,VARIANT   Key)
{
	/*
		Copy and paste the following directives to your header file as
		it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'
		#import <ExSurface.dll>
		using namespace EXSURFACELib;
	*/
	EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
	OutputDebugStringW( L"Key" );
}

EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->Images(_bstr_t("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTq") +
"lVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m" +
"0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/y" +
"NAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=");
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	EXSURFACELib::IElementPtr var_Element = var_Elements->Add("new element",vtMissing,vtMissing);
		var_Element->PutCaptionAlign(EXSURFACELib::exTopRight);
		var_Element->PutPicturesAlign(EXSURFACELib::exTopLeft);
		var_Element->PutShowHandCursorOn(EXSURFACELib::ShowHandCursorOnEnum(EXSURFACELib::exShowHandCursorAnchorAll | EXSURFACELib::exShowHandCursorPictures | EXSURFACELib::exShowHandCursorIcon | EXSURFACELib::exShowHandCursorPicture));
		var_Element->PutPictures(L"0,1,2");

8
How can I show the hand cursor when user hovers the element's image

// HandCursorClick event - The uses clicks a part of the element that shows the had cursor.
void OnHandCursorClickSurface1(LPDISPATCH   Element,long   Hit,VARIANT   Key)
{
	/*
		Copy and paste the following directives to your header file as
		it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'
		#import <ExSurface.dll>
		using namespace EXSURFACELib;
	*/
	EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
	OutputDebugStringW( L"Key" );
}

EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->Images(_bstr_t("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTq") +
"lVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m" +
"0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/y" +
"NAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=");
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	EXSURFACELib::IElementPtr var_Element = var_Elements->Add("new element",vtMissing,vtMissing);
		var_Element->PutCaptionAlign(EXSURFACELib::exTopRight);
		var_Element->PutPicturesAlign(EXSURFACELib::exTopLeft);
		var_Element->PutShowHandCursorOn(EXSURFACELib::ShowHandCursorOnEnum(EXSURFACELib::exShowHandCursorAnchorAll | EXSURFACELib::exShowHandCursorPictures | EXSURFACELib::exShowHandCursorIcon | EXSURFACELib::exShowHandCursorPicture));
		var_Element->PutPictures(L"0,1,2");

7
How can I show the hand cursor when user hovers the element's checkbox

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	EXSURFACELib::IElementPtr var_Element = var_Elements->Add("new element",vtMissing,vtMissing);
		var_Element->PutCaptionAlign(EXSURFACELib::exTopRight);
		var_Element->PutCheckBoxAlign(EXSURFACELib::exTopLeft);
		var_Element->PutShowCheckBox(VARIANT_TRUE);
		var_Element->PutShowHandCursorOn(EXSURFACELib::ShowHandCursorOnEnum(EXSURFACELib::exShowHandCursorAnchorAll | EXSURFACELib::exShowHandCursorCheck));

6
How can I remove the status part for all elements

// AddElement event - A new element has been added to the surface.
void OnAddElementSurface1(LPDISPATCH   Element)
{
	// Element.StatusSize = 0
}

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutBackground(EXSURFACELib::exElementStatusColor,-1);
spSurface1->GetElements()->Add("new element",vtMissing,vtMissing);

5
How can I remove the border for all elements

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutBackground(EXSURFACELib::exElementBorderColor,-1);
spSurface1->GetElements()->Add("new element",vtMissing,vtMissing);

4
How do I edit the element's caption once the user creates the element

// CreateElement event - The user creates at runtime a new element.
void OnCreateElementSurface1(LPDISPATCH   Element)
{
	// Element.Edit(0)
	// Element.AutoSize = True
}


3
How can I align the element's checkbox next to the text

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->BeginUpdate();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	EXSURFACELib::IElementPtr var_Element = var_Elements->Add("text",vtMissing,vtMissing);
		var_Element->PutShowCheckBox(VARIANT_TRUE);
		var_Element->PutCaptionAlign(EXSURFACELib::exTopRight);
		var_Element->PutCheckBoxAlign(EXSURFACELib::exTopLeft);
spSurface1->EndUpdate();

2
How can I assign a check-box to all elements

// AddElement event - A new element has been added to the surface.
void OnAddElementSurface1(LPDISPATCH   Element)
{
	// Element.ShowCheckBox = True
}

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->BeginUpdate();
EXSURFACELib::IElementsPtr var_Elements = spSurface1->GetElements();
	var_Elements->Add("",long(-24),long(-24));
	var_Elements->Add("",vtMissing,vtMissing)->PutChecked(EXSURFACELib::exChecked);
spSurface1->Home();
spSurface1->EndUpdate();

1
How do I change the control's background color

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXSURFACELib' for the library: 'ExSurface 1.0 Control Library'

	#import <ExSurface.dll>
	using namespace EXSURFACELib;
*/
EXSURFACELib::ISurfacePtr spSurface1 = GetDlgItem(IDC_SURFACE1)->GetControlUnknown();
spSurface1->PutBackColor(RGB(240,240,240));